package com.totem.base.enums;

import lombok.Getter;

import java.util.Objects;

public enum SwitchEnum {
    OFF("OFF"),
    ON("ON");
    @Getter
    private final String code;

    SwitchEnum(String code){
        this.code = code;
    }

    public static SwitchEnum byCode(String code) {
        for (SwitchEnum e: SwitchEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
